import "package:flutter/cupertino.dart";

class CommonState extends ChangeNotifier {
  Map? _apartment; // 公寓
  Map? _lock; // 门锁信息
  Map? _lockInfo; // 门锁硬件详情

  Map? get apartment => _apartment;
  Map? get lock => _lock;
  Map? get lockInfo => _lockInfo;

  // 设置公寓信息
  void setApartment(Map apartment) {
    _apartment = apartment;
    notifyListeners();
  }

  // 清除公寓信息
  void clearApartment() {
    _apartment = null;
    notifyListeners();
  }

  // 设置门锁信息
  void setLock(Map lock) {
    _lock = lock;
    notifyListeners();
  }

  // 清除门锁信息
  void clearLock() {
    _lock = null;
    notifyListeners();
  }

  // 设置门锁硬件详情
  void setLockInfo(Map lockInfo) {
    _lockInfo = lockInfo;
    notifyListeners();
  }

  // 清除门锁硬件详情
  void clearLockInfo() {
    _lockInfo = null;
    notifyListeners();
  }
}